Optimal. Leaf size=121 \[ \frac {(e f+d g)^2}{8 d^3 e^3 (d-e x)}-\frac {(e f-d g)^2}{8 d^2 e^3 (d+e x)^2}-\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d+e x)}+\frac {(3 e f-d g) (e f+d g) \tanh ^{-1}\left (\frac {e x}{d}\right )}{8 d^4 e^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 121, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {862, 90, 214}
\begin {gather*} \frac {(3 e f-d g) (d g+e f) \tanh ^{-1}\left (\frac {e x}{d}\right )}{8 d^4 e^3}+\frac {(d g+e f)^2}{8 d^3 e^3 (d-e x)}-\frac {(e f-d g)^2}{8 d^2 e^3 (d+e x)^2}-\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d+e x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 214
Rule 862
Rubi steps
\begin {align*} \int \frac {(f+g x)^2}{(d+e x) \left (d^2-e^2 x^2\right )^2} \, dx &=\int \frac {(f+g x)^2}{(d-e x)^2 (d+e x)^3} \, dx\\ &=\int \left (\frac {(e f+d g)^2}{8 d^3 e^2 (d-e x)^2}+\frac {(-e f+d g)^2}{4 d^2 e^2 (d+e x)^3}+\frac {e^2 f^2-d^2 g^2}{4 d^3 e^2 (d+e x)^2}+\frac {(3 e f-d g) (e f+d g)}{8 d^3 e^2 \left (d^2-e^2 x^2\right )}\right ) \, dx\\ &=\frac {(e f+d g)^2}{8 d^3 e^3 (d-e x)}-\frac {(e f-d g)^2}{8 d^2 e^3 (d+e x)^2}-\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d+e x)}+\frac {((3 e f-d g) (e f+d g)) \int \frac {1}{d^2-e^2 x^2} \, dx}{8 d^3 e^2}\\ &=\frac {(e f+d g)^2}{8 d^3 e^3 (d-e x)}-\frac {(e f-d g)^2}{8 d^2 e^3 (d+e x)^2}-\frac {e^2 f^2-d^2 g^2}{4 d^3 e^3 (d+e x)}+\frac {(3 e f-d g) (e f+d g) \tanh ^{-1}\left (\frac {e x}{d}\right )}{8 d^4 e^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 139, normalized size = 1.15 \begin {gather*} \frac {\frac {2 d (e f+d g)^2}{d-e x}-\frac {2 d^2 (e f-d g)^2}{(d+e x)^2}+\frac {4 d \left (-e^2 f^2+d^2 g^2\right )}{d+e x}+\left (-3 e^2 f^2-2 d e f g+d^2 g^2\right ) \log (d-e x)+\left (3 e^2 f^2+2 d e f g-d^2 g^2\right ) \log (d+e x)}{16 d^4 e^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 180, normalized size = 1.49
method | result | size |
default | \(-\frac {-d^{2} g^{2}+e^{2} f^{2}}{4 e^{3} d^{3} \left (e x +d \right )}+\frac {\left (-d^{2} g^{2}+2 d e f g +3 e^{2} f^{2}\right ) \ln \left (e x +d \right )}{16 e^{3} d^{4}}-\frac {d^{2} g^{2}-2 d e f g +e^{2} f^{2}}{8 e^{3} d^{2} \left (e x +d \right )^{2}}+\frac {\left (d^{2} g^{2}-2 d e f g -3 e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{16 e^{3} d^{4}}+\frac {d^{2} g^{2}+2 d e f g +e^{2} f^{2}}{8 e^{3} d^{3} \left (-e x +d \right )}\) | \(180\) |
norman | \(\frac {-\frac {-d^{2} g^{2}-2 d e f g +e^{2} f^{2}}{4 d \,e^{3}}-\frac {\left (-3 d^{2} g^{2}-2 d e f g -3 e^{2} f^{2}\right ) x}{8 e^{2} d^{2}}+\frac {\left (-d^{2} g^{2}+2 d e f g +3 e^{2} f^{2}\right ) x^{2}}{8 e \,d^{3}}}{\left (e x +d \right )^{2} \left (-e x +d \right )}+\frac {\left (d^{2} g^{2}-2 d e f g -3 e^{2} f^{2}\right ) \ln \left (-e x +d \right )}{16 e^{3} d^{4}}-\frac {\left (d^{2} g^{2}-2 d e f g -3 e^{2} f^{2}\right ) \ln \left (e x +d \right )}{16 e^{3} d^{4}}\) | \(188\) |
risch | \(\frac {-\frac {\left (d^{2} g^{2}-2 d e f g -3 e^{2} f^{2}\right ) x^{2}}{8 e \,d^{3}}+\frac {\left (3 d^{2} g^{2}+2 d e f g +3 e^{2} f^{2}\right ) x}{8 e^{2} d^{2}}+\frac {d^{2} g^{2}+2 d e f g -e^{2} f^{2}}{4 d \,e^{3}}}{\left (e x +d \right ) \left (-e^{2} x^{2}+d^{2}\right )}+\frac {\ln \left (e x -d \right ) g^{2}}{16 e^{3} d^{2}}-\frac {\ln \left (e x -d \right ) f g}{8 e^{2} d^{3}}-\frac {3 \ln \left (e x -d \right ) f^{2}}{16 e \,d^{4}}-\frac {\ln \left (-e x -d \right ) g^{2}}{16 e^{3} d^{2}}+\frac {\ln \left (-e x -d \right ) f g}{8 e^{2} d^{3}}+\frac {3 \ln \left (-e x -d \right ) f^{2}}{16 e \,d^{4}}\) | \(235\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 200, normalized size = 1.65 \begin {gather*} -\frac {2 \, d^{4} g^{2} + 4 \, d^{3} f g e - 2 \, d^{2} f^{2} e^{2} - {\left (d^{2} g^{2} e^{2} - 2 \, d f g e^{3} - 3 \, f^{2} e^{4}\right )} x^{2} + {\left (3 \, d^{3} g^{2} e + 2 \, d^{2} f g e^{2} + 3 \, d f^{2} e^{3}\right )} x}{8 \, {\left (d^{3} x^{3} e^{6} + d^{4} x^{2} e^{5} - d^{5} x e^{4} - d^{6} e^{3}\right )}} - \frac {{\left (d^{2} g^{2} - 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e + d\right )}{16 \, d^{4}} + \frac {{\left (d^{2} g^{2} - 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left (x e - d\right )}{16 \, d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 399 vs.
\(2 (116) = 232\).
time = 2.07, size = 399, normalized size = 3.30 \begin {gather*} -\frac {4 \, d^{5} g^{2} + 6 \, d f^{2} x^{2} e^{4} + 2 \, {\left (2 \, d^{2} f g x^{2} + 3 \, d^{2} f^{2} x\right )} e^{3} - 2 \, {\left (d^{3} g^{2} x^{2} - 2 \, d^{3} f g x + 2 \, d^{3} f^{2}\right )} e^{2} + 2 \, {\left (3 \, d^{4} g^{2} x + 4 \, d^{4} f g\right )} e - {\left (d^{5} g^{2} + 3 \, f^{2} x^{3} e^{5} + {\left (2 \, d f g x^{3} + 3 \, d f^{2} x^{2}\right )} e^{4} - {\left (d^{2} g^{2} x^{3} - 2 \, d^{2} f g x^{2} + 3 \, d^{2} f^{2} x\right )} e^{3} - {\left (d^{3} g^{2} x^{2} + 2 \, d^{3} f g x + 3 \, d^{3} f^{2}\right )} e^{2} + {\left (d^{4} g^{2} x - 2 \, d^{4} f g\right )} e\right )} \log \left (x e + d\right ) + {\left (d^{5} g^{2} + 3 \, f^{2} x^{3} e^{5} + {\left (2 \, d f g x^{3} + 3 \, d f^{2} x^{2}\right )} e^{4} - {\left (d^{2} g^{2} x^{3} - 2 \, d^{2} f g x^{2} + 3 \, d^{2} f^{2} x\right )} e^{3} - {\left (d^{3} g^{2} x^{2} + 2 \, d^{3} f g x + 3 \, d^{3} f^{2}\right )} e^{2} + {\left (d^{4} g^{2} x - 2 \, d^{4} f g\right )} e\right )} \log \left (x e - d\right )}{16 \, {\left (d^{4} x^{3} e^{6} + d^{5} x^{2} e^{5} - d^{6} x e^{4} - d^{7} e^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 279 vs.
\(2 (105) = 210\).
time = 0.63, size = 279, normalized size = 2.31 \begin {gather*} \frac {- 2 d^{4} g^{2} - 4 d^{3} e f g + 2 d^{2} e^{2} f^{2} + x^{2} \left (d^{2} e^{2} g^{2} - 2 d e^{3} f g - 3 e^{4} f^{2}\right ) + x \left (- 3 d^{3} e g^{2} - 2 d^{2} e^{2} f g - 3 d e^{3} f^{2}\right )}{- 8 d^{6} e^{3} - 8 d^{5} e^{4} x + 8 d^{4} e^{5} x^{2} + 8 d^{3} e^{6} x^{3}} + \frac {\left (d g - 3 e f\right ) \left (d g + e f\right ) \log {\left (- \frac {d \left (d g - 3 e f\right ) \left (d g + e f\right )}{e \left (d^{2} g^{2} - 2 d e f g - 3 e^{2} f^{2}\right )} + x \right )}}{16 d^{4} e^{3}} - \frac {\left (d g - 3 e f\right ) \left (d g + e f\right ) \log {\left (\frac {d \left (d g - 3 e f\right ) \left (d g + e f\right )}{e \left (d^{2} g^{2} - 2 d e f g - 3 e^{2} f^{2}\right )} + x \right )}}{16 d^{4} e^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.99, size = 194, normalized size = 1.60 \begin {gather*} -\frac {{\left (d^{2} g^{2} - 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | x e + d \right |}\right )}{16 \, d^{4}} + \frac {{\left (d^{2} g^{2} - 2 \, d f g e - 3 \, f^{2} e^{2}\right )} e^{\left (-3\right )} \log \left ({\left | x e - d \right |}\right )}{16 \, d^{4}} - \frac {{\left (2 \, d^{5} g^{2} + 4 \, d^{4} f g e - 2 \, d^{3} f^{2} e^{2} - {\left (d^{3} g^{2} e^{2} - 2 \, d^{2} f g e^{3} - 3 \, d f^{2} e^{4}\right )} x^{2} + {\left (3 \, d^{4} g^{2} e + 2 \, d^{3} f g e^{2} + 3 \, d^{2} f^{2} e^{3}\right )} x\right )} e^{\left (-3\right )}}{8 \, {\left (x e + d\right )}^{2} {\left (x e - d\right )} d^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.15, size = 198, normalized size = 1.64 \begin {gather*} \frac {\frac {d^2\,g^2+2\,d\,e\,f\,g-e^2\,f^2}{4\,d\,e^3}+\frac {x\,\left (3\,d^2\,g^2+2\,d\,e\,f\,g+3\,e^2\,f^2\right )}{8\,d^2\,e^2}+\frac {x^2\,\left (-d^2\,g^2+2\,d\,e\,f\,g+3\,e^2\,f^2\right )}{8\,d^3\,e}}{d^3+d^2\,e\,x-d\,e^2\,x^2-e^3\,x^3}+\frac {\mathrm {atanh}\left (\frac {e\,x\,\left (d\,g+e\,f\right )\,\left (d\,g-3\,e\,f\right )}{d\,\left (-d^2\,g^2+2\,d\,e\,f\,g+3\,e^2\,f^2\right )}\right )\,\left (d\,g+e\,f\right )\,\left (d\,g-3\,e\,f\right )}{8\,d^4\,e^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________